import pymysql

def store_data_in_database(data):
    # 连接到MySQL数据库
    # 导入pymysql包

    # 创建数据库连接
    conn = pymysql.connect(host="localhost", port=3306, user="root", passwd="root", db="data_analyze")
    cursor = conn.cursor()

    insert_query = "INSERT INTO hot_search (hot_content, search_link, ranking_time, highest_rank, duration, duration_number, search_index_peak, platform) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)"

    cursor.execute(insert_query, data)

    # 提交更改并关闭连接
    conn.commit()
    conn.close()
